1. Field of the Invention
Embodiments of the invention are generally related to computer database systems. More particularly, embodiments of the invention are related to decomposing a particularly long or complex database query into more manageable conditional groups.
2. Description of the Related Art
Databases are computerized information storage and retrieval systems. A relational database management system (RDBMS) is a computer database management system that uses relational techniques for storing and retrieving data. Relational databases are computerized information systems in which data in the form of rows, columns and tables are typically stored on disk drives or similar mass data stores. A database schema is used to specify data is stored in a collection of tables and how the tables are related to one another. Each database table includes a set of rows (also referred to as records) spanning one or more columns.
A database query refers to a set of commands or clauses for retrieving data stored in a database. Database queries may come from users, application programs, or remote systems. A query may specify which columns to retrieve data from, how to join columns from multiple tables, and conditions that must be satisfied for a particular data record to be included in a query result set. Current relational databases typically process queries composed in an exacting format specified by a query language. For example, the widely used query language SQL (short for Structured Query Language) is supported by virtually every database available today.
As a practical matter, a database query may only be so long or complex before reaching the limits of technology. Running large or complex query may use too many resources of a database system, potentially crashing the database or the entire database system. Accordingly, database programs are designed to prevent this result by placing constraints on size or logical-complexity of a query. For example, in IBM's DB2 Universal Database, a query is limited to 64 kilobytes in size. Furthermore, DB2 will reject a query smaller than 64 kilobytes if the query contains too many conditional elements.
However, disciplines which rely heavily on databases, such as life sciences, require increasingly complex databases and database queries. Accordingly, database users encounter query size or complexity limiting constraints more frequently. Often a complex query cannot be performed, or, when the query is performed, its complexity causes the system to operate very slowly.
Accordingly, what is needed is a method and system for executing a complex database query on a database system while not greatly diminishing the performance of the database system.